package org.millioncall.yueyoga.admin.model.base;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;

import org.millioncall.yueyoga.admin.model.Account;
import org.millioncall.yueyoga.admin.model.DbFile;
import org.millioncall.yueyoga.admin.model.Group;
import org.millioncall.yueyoga.admin.model.UserDetail;

public abstract class BaseUser implements java.io.Serializable {
	private static final long serialVersionUID = -6008318950266685516L;
	private String id = UUID.randomUUID().toString().replaceAll("-", "");
	private String username;
	private String password;
	private String email;
	private List<Group> groups;
	private boolean enabled = true;// 默认启用
	private int status = 1;// 默认状态正常
	private int loginTimes = 0;// 默认登录次数0
	private Date lastLoginTime;
	private String lastLoginIp;
	private Date expireTime;
	private Date authorityExpireTime;
	private boolean locked = false;// 默认未锁定
	private int pwdWrongTimes = 0;
	private Date lastPwdWrongTime;
	private DbFile headImgFile;
	private Date createTime = new Date();// 用户创建时间
	private UserDetail userDetail;
	private Account account;// 账户，虚拟货币
	private String groupId;
	private String groupName;
	private String organizationId;// 分馆编号
	private String namecns;

	public String getNamecns() {
		return namecns;
	}

	public void setNamecns(String namecns) {
		this.namecns = namecns;
	}

	public BaseUser() {
		groups = new ArrayList<Group>();
	}

	public BaseUser(String username, String password, String email) {
		this();
		this.username = username;
		this.password = password;
		this.email = email;
	}

	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public boolean isEnabled() {
		return enabled;
	}

	public void setEnabled(boolean enabled) {
		this.enabled = enabled;
	}

	public int getStatus() {
		return this.status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public int getLoginTimes() {
		return loginTimes;
	}

	public void setLoginTimes(int loginTimes) {
		this.loginTimes = loginTimes;
	}

	public Date getLastLoginTime() {
		return lastLoginTime;
	}

	public void setLastLoginTime(Date lastLoginTime) {
		this.lastLoginTime = lastLoginTime;
	}

	public String getLastLoginIp() {
		return lastLoginIp;
	}

	public void setLastLoginIp(String lastLoginIp) {
		this.lastLoginIp = lastLoginIp;
	}

	public Date getExpireTime() {
		return expireTime;
	}

	public void setExpireTime(Date expireTime) {
		this.expireTime = expireTime;
	}

	public Date getAuthorityExpireTime() {
		return authorityExpireTime;
	}

	public void setAuthorityExpireTime(Date authorityExpireTime) {
		this.authorityExpireTime = authorityExpireTime;
	}

	public boolean isLocked() {
		return locked;
	}

	public void setLocked(boolean locked) {
		this.locked = locked;
	}

	public int getPwdWrongTimes() {
		return pwdWrongTimes;
	}

	public void setPwdWrongTimes(int pwdWrongTimes) {
		this.pwdWrongTimes = pwdWrongTimes;
	}

	public Date getLastPwdWrongTime() {
		return lastPwdWrongTime;
	}

	public void setLastPwdWrongTime(Date lastPwdWrongTime) {
		this.lastPwdWrongTime = lastPwdWrongTime;
	}

	public DbFile getHeadImgFile() {
		return headImgFile;
	}

	public void setHeadImgFile(DbFile headImgFile) {
		this.headImgFile = headImgFile;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public UserDetail getUserDetail() {
		return userDetail;
	}

	public void setUserDetail(UserDetail userDetail) {
		this.userDetail = userDetail;
	}

	public Account getAccount() {
		return account;
	}

	public void setAccount(Account account) {
		this.account = account;
	}

	public List<Group> getGroups() {
		return groups;
	}

	public void setGroups(List<Group> groups) {
		this.groups = groups;
	}

	public String getGroupId() {
		return groupId;
	}

	public void setGroupId(String groupId) {
		this.groupId = groupId;
	}

	public String getOrganizationId() {
		return organizationId;
	}

	public void setOrganizationId(String organizationId) {
		this.organizationId = organizationId;
	}

	public String getGroupName() {
		return groupName;
	}

	public void setGroupName(String groupName) {
		this.groupName = groupName;
	}
}